<?php

namespace App\Models\Goods;

use Illuminate\Database\Eloquent\Model;

class Cates extends Model
{
    protected $fillable = [
        'cate_name','cate_img','pid','sort','is_home'
    ];

    public function pcate()
    {
        return $this->hasOne(Cates::class,'id','pid');
    }

    public function ccate()
    {
        return $this->hasMany(Cates::class,'pid','id');
    }
}
